<?php
class Maillist_Model_Subscriber{
    public $Id;
    public $Email;
    public $Name1;
    public $Name2;
    public $Name3;
    public $Phone;
    public $JoinDate;
    public $Active;
   
    
    public function __construct($options = null){
        if ($options instanceof Maillist_Model_Subscribers)
    	{
    		$options = $options->toArray();
    		$this->setOptions($options);
    	}
        else if (is_array($options)) {
            $this->setOptions($options);
        }
    }
    
    public function setOptions(array $options){
        $methods = get_class_methods($this);
        foreach ($options as $key => $value) {
            $method = 'set' . ucfirst($key);
            if (in_array($method, $methods)) {
                $this->$method($value);
            }
        }
        return $this;
    }
    
    public function toArray(){
    	$vars = get_class_vars(get_class($this));
        foreach ($vars as $var=>$value)
        {
        		$vars[$var] = $this->$var;
        }
        return $vars;
    }
    
    public function getId(){return $this->Id;}
    public function getEmail(){return $this->Email;}
    public function getName1(){return $this->Name1;}
    public function getName2(){return $this->Name2;}
    public function getName3(){return $this->Name3;}
    public function getJoinDate(){return $this->JoinDate;}
    public function getActive(){return $this->Active;}
    public function getPhone(){return $this->Phone;}
    
    public function setId($v){$this->Id=$v;return $this;}
    public function setEmail($v){$this->Email=$v;return $this;}
    public function setName1($v){$this->Name1=$v;return $this;}
    public function setName2($v){$this->Name2=$v;return $this;}
    public function setName3($v){$this->Name3=$v;return $this;}
    public function setJoinDate($v){$this->JoinDate = $v; return $this;}
    public function setActive($v){$this->Active = $v; return $this;}
    public function setPhone($v){$this->Phone = $v; return $this;}
}
?>